package games.gameObjects;


import pt.iul.poo.image.SimpleImage;
import gameUtils.Coordinate;
import games.gameObjects.towers.*;

/**
 * 
 * @author Júlio Sousa, Iscte, 2012/2013
 * 
 * <<abstract>> class Game Object
 * This class is the base class for 
 * any game object that exist in the game
 */
public abstract class TDObject {

	private Coordinate objectCoordinate;
	private int priority;

	/**
	 * Constructor of the GameObject
	 * It defines the coordinate and the priority it has in the game
	 * @param c
	 * @param priority
	 */
	public TDObject(final Coordinate c, final int priority){
		super();
		
		this.objectCoordinate = c;
		this.priority = priority;
	}
	/**
	 * 
	 * @return the current Coordinate that a GameObject have
	 * @see Coordinate
	 */
	public Coordinate getCoordinate() {
		return objectCoordinate;
	}
	/**
	 * Modifies the GameObject Coordinate
	 * @param the coordinate
	 * @see Coordinate
	 */
	public void setCoordinate(final Coordinate objectCoordinate) {
		setCoordinate(objectCoordinate.getAbcissa(), objectCoordinate.getOrdinate());
	}
	/**
	 * Modifies the GameObject Coordinate
	 * @param the coordinate (x,y)
	 * @see Coordinate
	 */
	public void setCoordinate(final int x, final int y) {
		this.objectCoordinate.setAbcissa(x);
		this.objectCoordinate.setOrdinate(y);
	}
	/**
	 * Returns the value of the priority that an image
	 * has in the game
	 * @return the priority of the game object
	 */
	public int getPriority() {
		return priority;
	}

	/**
	 * Returns the an image of the type Simple Image that paints a static game object
	 * @return SimpleImage - It returns an Image of the type SimpleImage
	 */
	public abstract SimpleImage getImage();
	/**
	 * String representation of a Game Object
	 */
	public abstract String toString();

	
	public abstract String getTDClass();
	
	/**
	 * Tester Game Object
	 * @param args
	 */
	public static void main(String[] args) {

		TDObject go = new Tower1(new Coordinate(1,1));
		System.out.println(go.toString());




	}}
